home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: New Zealand Amiga Users Group / New Zealand Amiga Users Group Newsdisk v25 (1989-08)(NZAmigaUG).zip / New Zealand Amiga Users Group Newsdisk v25 (1989-08)(NZAmigaUG).adf / StrucBrowser / sb.src.zoo / sbexecbase.c < prev    next >
C/C++ Source or Header  |  1988-06-22  |  5KB  |  143 lines

  1. /************************************************************************
  2. *                                    *
  3. *                SBExecBase                *
  4. *                                    *
  5. *    by David Annett, 3 Sutherland Ave, Upper Hutt, New Zealand    *
  6. *                                    *
  7. *                17 July 89                *
  8. *                                    *
  9. *************************************************************************/
  10.  
  11. #include "sb.h"
  12. extern int level;
  13. extern struct ExecBase *ExecBase;
  14. extern void PrExecBase2();
  15. extern void PrExecBase3();
  16.  
  17. void PrExecBase(string, EBase) char *string; struct ExecBase *EBase;
  18. {
  19. static struct StructData structdata[] = {
  20.      { " LibNode",      "struct Library",      0, SZ(Library)    },
  21.      { "-SoftVer",    "UWORD",          12, INTSIZE    },
  22.      { "-LowMemChkSum",    "WORD",               2, INTSIZE    },
  23.      { "(ColdCapture",  "APTR)",               5, PTRSIZE    },
  24.      { "(CoolCapture",  "APTR)",               5, PTRSIZE    },
  25.      { "(WarmCapture",  "APTR)",               5, PTRSIZE    },
  26.      { "(SysStkUpper",  "APTR)",               5, PTRSIZE    },
  27.      { "(SysStkLower",  "APTR)",               5, PTRSIZE    },
  28.      { "-MaxLocMem",    "ULONG",          12, PTRSIZE    },
  29.      { "(DebugEntry",   "APTR)",               5, PTRSIZE    },
  30.      { "(DebugData",    "APTR)",               5, PTRSIZE    },
  31.      { "(AlertData",    "APTR)",               5, PTRSIZE    },
  32.      { "(MaxExtMem",    "APTR)",               5, PTRSIZE    },
  33.      { "-ChkSum",    "UWORD",          12, INTSIZE    },
  34.      { "(IntVects[16]", "struct IntVector)",   5, SZ(IntVector) * 16 },
  35.      { "(ThisTask",     "struct Task *)",      5, PTRSIZE    }
  36.   };
  37. int sum, choice = -1;
  38.   level++;
  39.   while (choice) {
  40.     sum = SetOptionText(string, structdata, (APTR)EBase, DATASIZE, 0);
  41.     switch (choice = GetChoice(MAXGADG + 1)) {
  42.       case        1:
  43.       PrLibrary ("Exec base library node", &EBase->LibNode);
  44.     break;
  45.       case MOREGADG:
  46.     PrExecBase2(" ExecBase (page 2)", EBase, sum);
  47.         break;
  48.     }
  49.   }
  50.   level--;
  51. }
  52.  
  53. void PrExecBase2(string, EBase, offset) char *string; struct ExecBase *EBase;
  54. int offset;
  55. {
  56. static struct StructData structdata[] = {
  57.      { "-IdleCount",    "ULONG",              12, PTRSIZE    },
  58.      { "-DispCount",    "ULONG",              12, PTRSIZE    },
  59.      { "-Quantum",      "UWORD",              12, INTSIZE    },
  60.      { "-Elapsed",      "UWORD",              12, INTSIZE    },
  61.      { "-SysFlags",     "UWORD",              12, INTSIZE    },
  62. /*     { "-IDNestCnt",    "BYTE",                2, BYTESIZE    },
  63.      { "-TDNestCnt",    "BYTE",                2, BYTESIZE    },*/
  64.      { "-IDNestCnt",    "BYTE",                2, INTSIZE    },
  65.      { "-TDNestCnt",    "BYTE",                2, INTSIZE    },
  66.      { "-AttnFlags",    "UWORD",              12, INTSIZE    },
  67.      { "-AttnResched",  "UWORD",              12, INTSIZE    },
  68.      { "(ResModules",   "APTR)",               5, PTRSIZE    },
  69.      { "(TaskTrapCodes","APTR)",               5, PTRSIZE    },
  70.      { "(TaskExceptCde","APTR)",               5, PTRSIZE    },
  71.      { "(TaskExitCode", "APTR)",               5, PTRSIZE    },
  72.      { "-TaskSigAlloc",    "ULONG",          12, PTRSIZE    },
  73.      { "-TaskTrapAlloc","UWORD",          12, INTSIZE    },
  74.      { " MemList",    "struct List",           5, SZ(List)    }
  75.   };
  76. int sum, choice = -1;
  77. UWORD bits;
  78.   level++;
  79.   while (choice) {
  80.     sum = SetOptionText(string, structdata, (APTR)EBase, DATASIZE, offset);
  81.     switch (choice = GetChoice(MAXGADG + 1)) {
  82.       case  16:
  83.     PrList("Exec's MemList List structure",&EBase->MemList);
  84.         break;
  85.       case MOREGADG:
  86.     PrExecBase3(" ExecBase (page 3)", EBase, sum);
  87.         break;
  88.     }
  89.   }
  90.   level--;
  91. }
  92.  
  93. void PrExecBase3(string, EBase, offset) char *string; struct ExecBase *EBase;
  94. int offset;
  95. {
  96. static struct StructData structdata[] = {
  97.      { " ResourceList",    "struct List",           5, SZ(List)    },
  98.      { " DeviceList",    "struct List",           5, SZ(List)    },
  99.      { " IntrList",    "struct List",           5, SZ(List)    },
  100.      { " LibList",    "struct List",           5, SZ(List)    },
  101.      { " PortList",    "struct List",           5, SZ(List)    },
  102.      { " TaskReady",    "struct List",           5, SZ(List)    },
  103.      { " TaskWait",    "struct List",           5, SZ(List)    },
  104.      { "(SoftInts[5]",  "struct SoftIntList)", 5, SZ(SoftIntList) * 5 },
  105.      { " LastAlert[4]", "ULONG",           0, PTRSIZE * 4    }
  106.   };
  107. int sum, choice = -1;
  108. UWORD bits;
  109.   level++;
  110.   while (choice) {
  111.     sum = SetOptionText(string, structdata, (APTR)EBase, DATASIZE, offset);
  112.     switch (choice = GetChoice(DATASIZE)) {
  113.       case  1:
  114.     PrList("Exec's ResourceList List structure",&EBase->ResourceList);
  115.         break;
  116.       case  2:
  117.     PrList("Exec's DeviceList List structure",&EBase->DeviceList);
  118.         break;
  119.       case  3:
  120.     PrList("Exec's IntrList List structure",&EBase->IntrList);
  121.         break;
  122.       case  4:
  123.     PrList("Exec's LibList List structure",&EBase->LibList);
  124.         break;
  125.       case  5:
  126.     PrList("Exec's PortList List structure",&EBase->PortList);
  127.         break;
  128.       case  6:
  129.     PrList("Exec's TaskReady List structure",&EBase->TaskReady);
  130.         break;
  131.       case  7:
  132.     PrList("Exec's TaskWait List structure",&EBase->TaskWait);
  133.         break;
  134.       case  9:
  135.     HexDump("Hexdump of LastAlert Long words",&EBase->LastAlert[0],
  136.         PTRSIZE, (long)PTRSIZE * 4);
  137.         break;
  138.     }
  139.   }
  140.   level--;
  141. }
  142.  
  143.